package com.xuelang.pipeline.artifact.domain.resource.service.impl;

import com.xuelang.pipeline.artifact.client.common.result.PageRecord;
import com.xuelang.pipeline.artifact.client.resource.dto.ArtifactProxyQuery;
import com.xuelang.pipeline.artifact.domain.resource.ArtifactProxy;
import com.xuelang.pipeline.artifact.domain.resource.repository.ArtifactProxyRepository;
import com.xuelang.pipeline.artifact.domain.resource.service.ArtifactProxyDomainService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 制品仓库代理领域服务实现类
 *
 * @author xiwen.zxg
 * @since 2024/5/15
 */
@Service
public class ArtifactProxyDomainServiceImpl implements ArtifactProxyDomainService {

    @Autowired
    private ArtifactProxyRepository artifactProxyRepository;

    @Override
    public PageRecord<ArtifactProxy> pageList(long currentPage, long pageSize, ArtifactProxyQuery artifactProxyQuery) {
        return artifactProxyRepository.pageList(currentPage, pageSize, artifactProxyQuery);
    }

    @Override
    public List<ArtifactProxy> list(ArtifactProxyQuery artifactProxyQuery) {
        return artifactProxyRepository.list(artifactProxyQuery);
    }

    @Override
    public Boolean save(ArtifactProxy artifactProxy) {
        return artifactProxyRepository.save(artifactProxy);
    }

    @Override
    public Boolean update(ArtifactProxy artifactProxy) {
        return artifactProxyRepository.update(artifactProxy);
    }

    @Override
    public Boolean delete(String artifactProxyUuid) {
        return artifactProxyRepository.delete(artifactProxyUuid);
    }

    @Override
    public ArtifactProxy query(String artifactProxyUuid) {
        return artifactProxyRepository.query(artifactProxyUuid);
    }

    @Override
    public Boolean deleteByGroupArtifactUuid(String artifactUuid) {
        return artifactProxyRepository.deleteByGroupArtifactUuid(artifactUuid);
    }

    @Override
    public Boolean existsCurrentProxy(String groupArtifactUuid, String sourceArtifactUuid) {
        return artifactProxyRepository.existsCurrentProxy(groupArtifactUuid, sourceArtifactUuid);
    }

}
